#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_btnPause_clicked()
{
    if(QMediaPlayer:: PausedState != m_mediaPlayer.state()){
            m_mediaPlayer.setVolume(50);
            m_mediaPlayer.setMedia(QUrl::fromLocalFile("D:\\CloudMusic\\fish.mp3"));
        }
        m_mediaPlayer.play();
}

void MainWindow::on_btnPlay_clicked()
{
    if(QMediaPlayer:: PlayingState == m_mediaPlayer.state()){
            m_mediaPlayer.pause();}
}
